local skynet = require "skynet.manager"
local service_class = require "service_class"

local robot_mgr = class("robot_mgr",service_class)

function robot_mgr:ctor()
    robot_mgr.super.ctor(self)
end

function robot_mgr:reload()
    robot_mgr.super.reload(self)
end

local function register_robots(num)
    local uid_list = skynet.call('.guid_mgr','lua','register_robots',num)
    if not uid_list then
        return {}
    end

    return uid_list
end

function robot_mgr:register_robots(num)
    local ok,ret = xpcall(register_robots,debug.traceback,num)
    if not ok then
        errlog(num,ret)
        return {}
    end
    return ret
end

return robot_mgr